﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pahan.McuFusion.Common.Serialization
{
    /// <summary>
    /// Associates a surrogate with the device info type.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
    public sealed class DeviceInfoSurrogateAttribute : Attribute
    {
        /// <summary>
        /// Creates a new instance.
        /// </summary>
        /// <param name="surrogateType">
        /// The type of the surrogate. 
        /// The surrogate must implement <see cref="IBuilder{T}"/> interface.
        /// </param>
        public DeviceInfoSurrogateAttribute(Type surrogateType)
        {
            // TODO: Validate type.
            this.surrogateType = surrogateType;
        }

        /// <summary>
        /// Gets the surrogate type.
        /// </summary>
        public Type SurrogateType
        {
            get
            {
                return surrogateType;
            }
        }

        private readonly Type surrogateType;
    }
}
